﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Student
    {
        public int Id { get; set; }
        public string Name { get; set; }
        public int Age { get; set; }
        public  Student(int id,string name,int age)
        {
            this.Id = id;
            this.Name = name;
            this.Age = age;
        }
        public override string ToString()
        {
            return $"学号"+this.Id+"姓名"+this.Name+"年龄"+this.Age;
        }
    }
    class Idsort : IComparer<Student>
    {
        public int Compare(Student x, Student y)
        {
            return x.Id.CompareTo(y.Id);
        }
    }
    class Namesort : IComparer<Student>
    {
        public int Compare(Student x, Student y)
        {
            return x.Name.CompareTo(y.Name);
        }
    }
    class Agesort : IComparer<Student>
    {
        public int Compare(Student x, Student y)
        {
            return x.Age.CompareTo(y.Age);
        }
    }
}
